package com.gpay.erp.services.storage.impl;

import com.gpay.erp.core.dao.BaseDao;
import com.gpay.erp.core.dao.page.PagerModel;
import com.gpay.erp.services.common.SystemCommonService;
import com.gpay.erp.services.storage.MandanService;
import com.gpay.erp.services.storage.bean.Mandan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by wuzonghui on 15/11/23.
 */
@Service
public class MandanServiceImpl implements MandanService {
    @Resource
    private BaseDao dao;
    @Autowired
    private SystemCommonService systemCommonService;


    @Override
    public int insert(Mandan mandan) {
        return dao.insert("mandan.insert",mandan);
    }

    @Override
    public int delete(Mandan mandan) {
        return dao.delete("mandan.deleteByFstorageId",mandan);
    }

    @Override
    public int deletes(String[] ids) {
        return 0;
    }

    @Override
    public int update(Mandan mandan) {
        return 0;
    }

    @Override
    public Mandan selectOne(Mandan mandan) {
        return null;
    }

    @Override
    public Mandan selectById(String id) {
        return null;
    }

    @Override
    public PagerModel selectPageList(Mandan mandan) {
        return null;
    }

    @Override
    public List<Mandan> selectList(Mandan mandan) {
        return null;
    }

    @Override
    public List<Mandan> selectListByFid(String f_storageId) {
        return dao.selectList("mandan.selectByFstorageId",f_storageId);
    }
    @Override
    public Mandan selectByFstorageSubId(String f_storageSubId) {
        return (Mandan) dao.selectOne("mandan.selectByFstorageSubId",f_storageSubId);
    }


    /**
     * 获取码单号
     * @return
     */
    @Override
    public String getMandanCode() {

        String strCode = systemCommonService.saveSelectByName("MD005");
        return strCode;
    }
}
